#ifndef GOODS_LIST_OP_H
#define GOODS_LIST_OP_H

#include"value.h"
/*初始化头节点*/
extern Goodslist * init_list(void);

/*创建新节点*/
extern Goodslist * new_node(Goods data);

/*判断链表是否为空*/
extern bool is_empty(Goodslist *list);

/*插入节点*/
extern void insert_node(Goodslist * p,Goodslist * new);

/*删除节点*/
extern bool remove_node(Goodslist *mylist,Goodslist *delete);

/*根据查找节点*/
extern Goodslist* find_node(Goodslist* mylist,int id);

/*根据name查找节点*/
extern Goodslist* find_node_by_name(Goodslist* mylist,char *name);

/*根据type查找节点*/
extern Goodslist* find_node_by_type(Goodslist* mylist,char *type);
/*
** 功能：从文件加载数据
** filename		文件名字
*/ 
extern void file_load_data(Goodslist* head, const char *filename);

/*
** 功能：保存数据到文件
** filename		文件名字
*/ 
extern void file_save_data(Goodslist *head, const char *filename);
#endif